/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Application.MainForm;

/**
 * Kis uzenetablak megjelenito osztaly, foleg a hibauzeneteknek.
 * @author Stikmann
 */
import java.awt.*;
import java.awt.event.*;

public class MessageBox extends Dialog implements ActionListener {

    /**
     * Konstruktor, egyben modalisan megjeleniti az ablakot.
     * @param parent
     * @param title
     * @param message
     */
    @SuppressWarnings("LeakingThisInConstructor")
  public MessageBox(Frame parent, String title, String message) {
    super(parent, title, true);
    add(BorderLayout.CENTER, new Label(message));
    Panel p = new Panel();
    Button btn = new Button("OK");
    btn.addActionListener(this);
    p.add(btn);
    add(BorderLayout.SOUTH, p);
    pack();
    setLocationRelativeTo(null);
    setVisible(true);
  }

    /**
     * Az OK gomb event handlere, bezarja az ablakot.
     * @param evt
     */
  public void actionPerformed(ActionEvent evt) {
    dispose();
  }

}
